<template>
    <div class="item-wrapper flex space-x-2 w-screen overflow-scroll px-4">
        <div class="item flex-[0_0_auto] w-28 space-y-2 "
        v-for="(item,index) in items"
        :key="item.title"
        >
            <div class="item-image">
                <img :src="item.cover" :alt="item.name" class="rounded-lg">
            </div>
            <div class="item-info">
                <div class="item-name text-xs font-bold">{{ item.title }}</div>
                <div class="item-price text-xs font-bold">{{ getCurrenccy(item.price) }}</div>
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import type { RecentlyViewItem } from '@/types/home'  
//工具函数库
import {getCurrenccy} from '@/untils/untils'
// ts 里比 js 复杂
//核心数据
interface Props {
    items: RecentlyViewItem[]  // 类型推断，TS 能根据 props 定义中的类型推断出 items 的类型

}

defineProps<Props>()
</script>

<style lang="scss" scoped>

</style>